using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameRoot : MonoBehaviour
{
    private static GameRoot instance;

    private UIManager UIManager;

    public UIManager UIManager_Root;

   

    public static GameRoot GetInstance() 
    {
        if (instance == null)  
        {
            Debug.LogWarning("GameRoot Ins is false!");
            return instance;
        }

        return instance;
    }

    private void Awake()
    {
        if (instance == null) 
        {
            instance = this;
        }
        else 
        {
            Destroy(this.gameObject);
        }

        UIManager = new UIManager();
        UIManager_Root = UIManager;

    }

    // Start is called before the first frame update
    void Start()
    {
        DontDestroyOnLoad(this);
        UIManager_Root.CanvasObj = UIMethods.GetInstance().FindCanvas();

        //UIManager_Root.Push(new StartUIBase());
        #region StartScene设置

      
        #endregion

    }

    public void push(BasePanel basePanel)
    {
        UIManager_Root.Push(basePanel);

    }
    public void pop()
    {
        UIManager_Root.Pop(false);
    }

    public void popALL()
    {
        UIManager_Root.Pop(true);

    }
    // Update is called once per frame
    void Update()
    {
        
    }
}
